home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 6 / MacMania 6.toast / / Multimedia & Desktop / VideoToolbox / VideoToolboxSources / CardSlot.c < prev    next >
Text File  |  1994-09-10  |  667b  |  30 lines

  1. /* CardSlot.c
  2. Finds the first NuBus slot that contains a card of the given name.
  3. Returns -1 if there's no such card.
  4.  
  5. HISTORY:
  6. 1990 dgp wrote it.
  7. 8/24/91    dgp    Made compatible with THINK C 5.0.
  8. 11/23/92 dgp dropped obsolete support for THINK C 4.
  9. */
  10. #include "VideoToolbox.h"
  11.  
  12. OSErr CardSlot(char *cardName)
  13. {
  14.     SpBlock mySpBlock;
  15.     int error,slot;
  16.     unsigned char name[128];
  17.     
  18.     for(slot=9;slot<16;slot++){
  19.         mySpBlock.spSlot=slot;
  20.         error=SCkCardStat(&mySpBlock);
  21.         if(!error){
  22.             mySpBlock.spID=1;
  23.             mySpBlock.spResult=(long) &name;
  24.             error=SReadDrvrName(&mySpBlock);
  25.             if(!error && !strcmp(cardName,p2cstr(name)))return slot;
  26.         }
  27.     }
  28.     return -1;    /* no such card */
  29. }
  30.